<?

include('sys/init.php');

$current_user = hello();

$can_view = check_user_right('sections', 'view_users', $current_user['rights']);

////////////////////////////////////////////////////////////////////////////////


if(isset($_POST['kwords']) && strlen($_POST['kwords'])>0)
{
   $kwords = check_name($_POST['kwords'], true);
   
   if($can_view)
   {
      $users = ($kwords && strlen($kwords)>0) ? get_users($kwords) : get_users();
      
      if( is_array($users) && isset($users[0]['id']) ) die( html_userlist($users, false, true) );
      else die( get_template('error_nousers.html') );
      
   }
   else die( get_template('error_cantviewusers.html') );
}


// what else?

else die('what?..');





?>
